package com.zhny.protocol_v3_008.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zhny.protocol_v3_008.constant.DTypeCode;
import com.zhny.protocol_v3_008.constant.PTypeCode;
import com.zhny.protocol_v3_008.constant.ReplyCode;

import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author Alex
 * @date 2017年11月27日 下午5:44:40
 */
public class Reply {
	private int code;
	private String msg;
	private int type;
	private Map<String,Float> detail;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public Map<String, Float> getDetail() {
		return detail;
	}
	public void setDetail(Map<String, Float> detail) {
		this.detail = detail;
	}

	@Override
	public String toString() {
		return "{" +
				"code=" + ReplyCode.getName(code) +
				", msg='" + msg + '\'' +
				", type=" + PTypeCode.getName(type) +
				", detail=" + detail +
				'}';
	}

//	public Map<String,String> toMap()
//	{
//		Map<String,String> logMap= new HashMap<>();
//		logMap.put("数据包类型","应答");
//		logMap.put("创建时间",new Date().toLocaleString());
//		logMap.put("数据",detail.toString());
//		return logMap;
//	}
}
